﻿using System;
using System.Runtime.InteropServices;

internal partial class Interop
{
    internal partial class Secur32
    {
        [Flags]
        internal enum CredentialsUse : int
        {
            SECPKG_CRED_INBOUND = 1,
            SECPKG_CRED_OUTBOUND = 2,
            SECPKG_CRED_BOTH = (SECPKG_CRED_OUTBOUND | SECPKG_CRED_INBOUND),
        }

        internal enum Data_Rep : uint
        {
            SECURITY_NATIVE_DREP = 0x00000010,
            SECURITY_NETWORK_DREP = 0x00000000,
        }

        internal enum SEC_RESULT : uint
        {
            SEC_E_INSUFFICIENT_MEMORY = 0x80090300, //The function failed. There is not enough memory available to complete the requested action.
            SEC_E_INTERNAL_ERROR = 0x80090304, //The function failed. An error occurred that did not map to an SSPI error code.
            SEC_E_INVALID_HANDLE = 0x80100003, //The function failed. The handle passed to the function is not valid.
            SEC_E_INVALID_TOKEN = 0x80090308, //The function failed. The token passed to the function is not valid.
            SEC_E_LOGON_DENIED = 0x8009030C, //The logon failed.
            SEC_E_NO_AUTHENTICATING_AUTHORITY = 0x80090311, //The function failed. No authority could be contacted for authentication. This could be due to the following conditions:
            SEC_E_OK = 0x00000000, //The function succeeded. The security context received from the client was accepted. If an output token was generated by the function, it must be sent to the client process.
            SEC_I_COMPLETE_AND_CONTINUE = 0x00090314, //The function succeeded. The server must call CompleteAuthToken and pass the output token to the client. The server then waits for a return token from the client and then makes another call to AcceptSecurityContext (NTLM).
            SEC_I_COMPLETE_NEEDED = 0x00090313, //The function succeeded. The server must finish building the message from the client and then call the CompleteAuthToken function.
            SEC_I_CONTINUE_NEEDED = 0x00090312
        }

        [Flags]
        internal enum ASC_REQ : uint
        {
            ASC_REQ_DELEGATE = 0x00000001,
            ASC_REQ_MUTUAL_AUTH = 0x00000002,
            ASC_REQ_REPLAY_DETECT = 0x00000004,
            ASC_REQ_SEQUENCE_DETECT = 0x00000008,
            ASC_REQ_CONFIDENTIALITY = 0x00000010,
            ASC_REQ_USE_SESSION_KEY = 0x00000020,
            ASC_REQ_ALLOCATE_MEMORY = 0x00000100,
            ASC_REQ_USE_DCE_STYLE = 0x00000200,
            ASC_REQ_DATAGRAM = 0x00000400,
            ASC_REQ_CONNECTION = 0x00000800,
            ASC_REQ_CALL_LEVEL = 0x00001000,
            ASC_REQ_EXTENDED_ERROR = 0x00008000,
            ASC_REQ_STREAM = 0x00010000,
            ASC_REQ_INTEGRITY = 0x00020000,
            ASC_REQ_LICENSING = 0x00040000,
            ASC_REQ_IDENTIFY = 0x00080000,
            ASC_REQ_ALLOW_NULL_SESSION = 0x00100000,
            ASC_REQ_ALLOW_NON_USER_LOGONS = 0x00200000,
            ASC_REQ_ALLOW_CONTEXT_REPLAY = 0x00400000,
            ASC_REQ_FRAGMENT_TO_FIT = 0x00800000,
            ASC_REQ_FRAGMENT_SUPPLIED = 0x00002000,
            ASC_REQ_NO_TOKEN = 0x01000000,
            ASC_REQ_PROXY_BINDINGS = 0x04000000,
        }
    }
}
